//
//  WBComposeTypeButton.swift
//  SwiftWeibo
//
//  Created by Lausen on 2017/5/8.
//  Copyright © 2017年 id. All rights reserved.
//

import UIKit

class WBComposeTypeButton: UIControl {

    @IBOutlet weak var imageView: UIImageView!
    
    @IBOutlet weak var titleLabel: UILabel!
    
    /// 给按钮添加一个变量,可以传入按钮信息数组里面的类名
    var clsName: String?
    

    class func composeTypeButton(imageName: String,title: String) -> WBComposeTypeButton{
        
        let nib = UINib(nibName: "WBComposeTypeButton", bundle: nil)
     
        let btn = nib.instantiate(withOwner: nil, options: nil)[0] as! WBComposeTypeButton
        
        
        btn.imageView.image = UIImage(named: imageName)
        btn.titleLabel.text = title
        
        return btn
    }
}
